<?php

namespace App\Listeners;

use App\Models\Log;
use Illuminate\Auth\Events\Logout;


class LogSuccessfulLogout
{
    /**
     * Create the event listener.
     *
     * @return void
     */

    public function __construct()
    {

    }


    public function handle(Logout $event)
    {
        $log = new Log();
        $log->handlers = $event->user->name;
        $log->logs = $event->user->name.'登出';
        $log->user_id = $event->user->id;
        $log->save();
    }
}
